<template>
  <div>
    <!-- <button @click="()=>{$router.push('/prac11')}">下一步</button> -->
    <button @click="getCurrentUser()">获取登录人信息</button>
    <div>{{ username }}</div>
  </div>
</template>
<script lang="ts">
import axios from '@/api/http'

/**
 * 页面核心数据结构体说明文档
 *
 *
 */
// import from

export default {
  name: 'Prac1View',
  props: {
    sampleP: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      sampleD: 'value',
      username: ''
    }
  },
  computed: {
    /* sampleC() {
      return this.sampleD + "--";
    }, */
  },
  created() {},
  mounted() {},
  methods: {
    // sampleM() {},
    async getCurrentUser() {
      // const axiosEX = axios.create({
      //   baseURL:'http://localhost:8080',
      //   withCredentials:true,
      // });


      const res = await axios({
        method: 'get',
        url: '/currentUser'
      })
      this.username = res.data
    }
  },
  watch: {
    // sampleP(n, o) {},
  }
}
</script>

<!--<style scoped>-->
<style lang="scss" scoped></style>
